<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			const baseURL = 'http://192.168.2.100:3001';
		</script>

		<script src="../libs/jquery.min.js"></script>
		<script src="../libs/template-web.js"></script>

		<!-- 左侧导航栏模板标签 -->
		<script type="text/template" id="templateLi">
			{{each article}}
			<li><a href="list.html?id={{$value._id}}"><span class="iconfont icon-glass {{$value.className}}"></span>
					{{$value.title}}</a></li>
			{{/each}}
		</script>

		<!-- 轮播图模板标签 -->
		<script type="text/template" id="templateSlideDiv">
			{{each picSrc}}
			<div class="swiper-slide"><img src="{{baseURL}}{{$value.image}}" alt='图片未找到' /></div>
			{{/each}}
		</script>

		<!-- 热门推荐模板标签 -->
		<script type="text/template" id="templateHotsLi">
			{{each results}}
			<li>
				<a href="comment.html?id={{$value._id}}">
					<img src="{{baseURL}}{{$value.thumbnail}}" alt="图片未找到">
					<span>{{$value.title}}</span>
				</a>
			</li>
			{{/each}}
		</script>


		<!-- 随机推荐模板标签 -->
		<script type="text/template" id="templateRandomComment">
			{{each results}}
			<li>
				<a href="comment.html?id={{$value._id}}">
					<p class="title">{{$value.title}}</p>
					<p class="reading">阅读({{$value.meta.views}})</p>
					<div class="pic">
						<img src="{{baseURL}}{{$value.thumbnail}}" alt="图片未找到">
					</div>
				</a>
			</li>
			{{/each}}
		</script>

		<!-- 最新评论模板标签 -->
		<script type="text/template" id="templateNewestComment">
			{{each results}}
			<li>
				<a href="#">
					<div class="avatar">
						<img src="{{baseURL}}{{$value.author.avatar}}" alt="图片未找到">
					</div>
					<div class="txt">
						<p>
							<span>{{$value.author.nickName}}</span>{{$value.author.createTime}}说:
						</p>
						<p>{{$value.content}}</p>
					</div>
				</a>
			</li>
			{{/each}}
		</script>

		<!-- 最新发布模板标签 -->
		<script type="text/template" id="templateNewPublish">
			<h3>最新发布</h3>
			{{each results}}
				<div class="entry">
					<div class="head">
						<span class="sort">会生活</span>
						<a href="comment.html?id={{$value._id}}">{{$value.title}}</a>
					</div>
					<div class="main">
						<p class="info">{{$value.author.nickName}} 发表于 {{$value.author.createTime}}</p>
						<p class="brief">
							{{$value.content}}
						</p>
						<p class="extra">
							<span class="reading">阅读({{$value.meta.views}})</span>
							<span class="comment">评论({{$value.meta.comments}})</span>
							<a href="#" class="like">
								<i class="fa fa-thumbs-up"></i>
								<span>赞({{$value.meta.likes}})</span>
							</a>
							<a href="#" class="tags">
								分类：<span>{{$value.category.title}}</span>
							</a>
						</p>
						<a href="#" class="thumb">
							<img src="{{baseURL}}{{$value.thumbnail}}" alt="图片未找到">
						</a>
					</div>
				</div>
			{{/each}}
		</script>

		<!-- 分类列表模板标签 -->
		<script type="text/template" id="templateCategoriseList">
			<h3>{{results[0].category.title}}</h3>
			{{each results}}
				<div class="entry">
					<div class="head">
						<span class="sort">会生活</span>
						<a href="comment.html?id={{$value._id}}">{{$value.title}}</a>
					</div>
					<div class="main">
						<p class="info">{{$value.author.nickName}} 发表于 {{$value.author.createTime}}</p>
						<p class="brief">
							{{$value.content}}
						</p>
						<p class="extra">
							<span class="reading">阅读({{$value.meta.views}})</span>
							<span class="comment">评论({{$value.meta.comments}})</span>
							<a href="#" class="like">
								<i class="fa fa-thumbs-up"></i>
								<span>赞({{$value.meta.likes}})</span>
							</a>
							<a href="#" class="tags">
								分类：<span>{{$value.category.title}}</span>
							</a>
						</p>
						<a href="#" class="thumb">
							<img src="{{baseURL}}{{$value.thumbnail}}" alt="图片未找到">
						</a>
					</div>
				</div>
			{{/each}}
		</script>

		<!-- 文章模板标签 -->
		<script type="text/template" id="templateArticleContent">
			<p>当前位置: <a href="#">{{results.category.title}}</a> &gt; {{results.title}}</p>
			<h2>{{results.title}}</h2>
			<p>{{results.author.nickName}} 发布于 {{results.createAt}} &nbsp;分类:<a href="#"> <del>{{results.category.title}}</del> </a> &nbsp;阅读:({{results.meta.views}})  &nbsp;评论:({{results.meta.comments}})</p>
			<div class="articleContent">
				{{results.content}}
			</div>
		</script>

		<!-- 站点内容统计模板 -->
		<script type="text/template" id="templateWebsiteStatistic">
			<li class="list-group-item"><strong>{{results[0].postCount}}</strong>篇文章（<strong>{{results[0].draftCount}}</strong>篇草稿）</li>
			<li class="list-group-item"><strong>{{results[1].categoryCount}}</strong>个分类</li>
			<li class="list-group-item"><strong>{{results[2].commentCount}}</strong>条评论（<strong>0</strong>条待审核）</li>
		</script>

		<!-- 管理 全部文章tr模板 -->
		<script type="text/template" id="templateAllArticleTr">
			{{each results}}
			<tr>
				<td>{{$value.title}}</td>
				<td>{{$value.author.nickName}}</td>
				<td>{{$value.category.title}}</td>
				<td class="text-center">{{$value.createAt}}</td>
				<td class="text-center">{{$value.state}}</td>
				<td class="text-center">
					<a href="javascript:;" class="btn btn-default btn-xs">编辑</a>
					<a href="javascript:;" class="btn btn-danger btn-xs">删除</a>
				</td>
			</tr>
			{{/each}}
		</script>


		<!-- 管理 文章 分类目录tr模板 -->
		<script type="text/template" id="templateCategoryListTr">
			{{each results}}
			<tr>
				<td class="text-center"><input type="checkbox"></td>
				<td>{{$value.title}}</td>
				<td class="text-center">
					<a href="javascript:;" data-id="{{$value._id}}" class="btn btn-info btn-xs btn-modify">编辑</a>
					<a href="javascript:;" data-id="{{$value._id}}" class="btn btn-danger btn-xs btn-del">删除</a>
				</td>
			</tr>
			{{/each}}
		</script>

		<!-- 管理评论tr模板 -->
		<script type="text/template" id="templateCommentManageTr">
			{{each results}}
				{{if $value.state===1 }}
					<tr class="danger">
				{{else if $value.state===0 }}
					<tr>
				{{/if}}
				<td>{{$value.author.nickName}}</td>
				<td>{{$value.content}}</td>
				<td>{{$value.post.title}}</td>
				<td>{{$value.createAt}}</td>
				<td>{{$value.state}}</td>
				<td class="text-center">
					<a href="javascript:;" data-id="{{$value._id}}" class="btn btn-info btn-xs">批准</a>
					<a href="javascript:;" data-id="{{$value._id}}" class="btn btn-danger btn-xs">删除</a>
				</td>
			</tr>
			{{/each}}
		</script>
		
		<!-- 用户管理Tr模板 -->
		<script type="text/template" id="templateUserManageTr">
			{{each results}}
				<tr>
					<td class="text-center"><input type="checkbox"></td>
					<td class="text-center"><img class="avatar" src=baseURL+"{{$value.avatar}}"></td>
					<td>{{$value.email}}</td>
					<td>{{$value.nickName}}</td>
					<td>{{if $value.status===1 }} 已激活 {{else if $value.status===0 }} 未激活 {{/if}}</td>
					<td>{{if $value.role==='admin' }} 超级管理员 {{else if $value.role==='normal' }} 普通用户 {{/if}}</td>
					<td class="text-center">
						<a href="javascript:;" data-id="{{$value._id}}" class="btn btn-default btn-xs">编辑</a>
						<a href="javascript:;" data-id="{{$value._id}}" class="btn btn-danger btn-xs">删除</a>
					</td>
				</tr>
			{{/each}}
		</script>

	</body>
</html>
